Skip to content

perf: drop grep/closure indirection in winnowNodes#557

Merged
mna merged 1 commit into
PuerkitoBio:masterfrom
jvoisin:winnow-nodes-direct
May 28, 2026
Merged

perf: drop grep/closure indirection in winnowNodes#557
mna merged 1 commit into
PuerkitoBio:masterfrom
jvoisin:winnow-nodes-direct

Conversation

@jvoisin
Copy link
Copy Markdown
Contributor

@jvoisin jvoisin commented May 27, 2026

In the same spirit as #545, replaces costly grep() with a loop.

While escape analysis managed to stack-allocate the per-node Selection through grep's inlining, the closure capture itself (nodes and keep) was still heap-allocated. Local benchmarks are showing a 30% allocs/op reduction, and a ~10-20% reduction in sec/op.

In the same spirit as PuerkitoBio#545, replaces costly grep() with a loop.

While escape analysis managed to stack-allocate the per-node
Selection through grep's inlining, the closure capture itself (nodes and keep)
was still heap-allocated. Local benchmarks are showing a 30% allocs/op
reduction, and a ~10-20% reduction in sec/op.
@mna mna merged commit b2b7542 into PuerkitoBio:master May 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants